<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>成绩统计</title>
    <!--    引入Echarts-->
    <script src="../vue/echarts.js"></script>
    <script src="../vue/vue.js"></script>
    <script src="../vue/axios.v0.21.1.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>

<div id="root" style="height: 800px;width: 1000px">

</div>

</body>
<script type="text/javascript">
    var myEcharts =  echarts.init(document.getElementById("root"));
    axios.get("/achievement/getOneScore").then((res)=> {
        myEcharts.setOption({
            title: {
                text: '班级成绩'
            },
            tooltip: {},
            xAxis: {
                data: res.data.data.majors,
            },
            yAxis: {},
            series: [
                {
                    type: 'bar',
                    data: res.data.data.scores,
                    color: 'rgba(138,43,226,0.5)',
                }
            ]
        });
    });

</script>

</html>